home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / DLGoodies / showdvi.dopus5 < prev    next >
Text File  |  1996-08-29  |  1KB  |  54 lines

  1. /*
  2.  *  Load selected 'dvi' files from an DOpus lister into ShowDVI. If
  3.  *  ShowDVI port is found, files are loaded directly, otherwise ShowDVI
  4.  *  is invoked first.
  5.  *
  6.  *  V1.0 (12.7.96) by David Lübbren.
  7.  *
  8.  *  Installation:
  9.  *    Create a file type DVI with the following:
  10.  *       Compare Name  #?.dvi        (or something more sophisticated)
  11.  *
  12.  *    Add the following action:
  13.  *       DoubleClick  Arexx  DOpus5:ARexx/showdvi {Qp} {f}
  14.  *
  15.  */
  16.  
  17. StackSize   = 8192
  18. ShowDVIPort = 'showdvi'
  19.  
  20. OPTIONS RESULTS
  21.  
  22. PARSE ARG dopusport file .
  23. IF dopusport ~= "" THEN ADDRESS VALUE dopusport
  24. else do
  25.   say "No DOpus running !"
  26.   exit
  27. end
  28.  
  29. file = STRIP(file, 'B', '"')
  30.  
  31. IF ~SHOW('Ports', ShowDVIPort) THEN DO
  32.   PRAGMA('Stack', StackSize)
  33.   ADDRESS COMMAND
  34.   'run <nil: >nil: TeXMF:bin/pastex/ShowDVI' file
  35.   'WaitForPort' ShowDVIPort
  36.   ADDRESS
  37.   IF rc = 5 THEN DO
  38.     dopus request '"Unable to load ''ShowDVI''" Cancel'
  39.     EXIT 20
  40.   END
  41. END
  42. ELSE DO
  43.   ADDRESS VALUE ShowDVIPort
  44.   loadnew file
  45.   ADDRESS
  46.   ADDRESS VALUE ShowDVIPort
  47.   'tofront'
  48.   'activate'
  49.   ADDRESS
  50. END
  51.  
  52. EXIT 0
  53.  
  54.